import {hrAjax as proFetch} from 'src/hrpub/common/utils/utils';

export default function getExportInitData(exportType) {
    const {humanResourceOrganizationValue} = this.state;
    let postData = {
        pk_org: humanResourceOrganizationValue.refpk,
        func_type: 2
    };
    return proFetch({
        url: '/nccloud/hrhi/psndoc/PsndocExportPsninfoInitAction.do',
        body: postData,
    })
        .then((res) => {
            if (res.success) {
                this.props.modal.show('infoExport');
                this.updateState({
                    exportType,
                    exportFilter: res.data.map(item => {
                        return {
                            key: item.value,
                            title: item.display,
                            description: item.display
                        }
                    })
                })
            }
        });
}
